#coding:utf8
from django.conf.urls import url
from . import views

from rest_framework_jwt.views import obtain_jwt_token
urlpatterns = [

    #/users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameView.as_view()),

    url(r'^$',views.RegisterCreateUserView.as_view()),

    # /users/phones/(?P<mobile>1[345789]\d{9})/count/
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$', views.RegisterPhoneCountAPIView.as_view(), name='phonecount'),

    #添加登录认证
    # url(r'^auths/',obtain_jwt_token),

    url(r'^auths/', views.UserAuthorizationView.as_view()),
    # 信息
    url(r'infos/',views.UserCenterInfoView.as_view()),
    # 邮箱
    url(r'^emails/$',views.UserUpdateEmailView.as_view()),
     # 收货地址
    url(r'^addresses/$',views.AddressCreateAPIView.as_view()),
    url(r'^addresses1/(?P<pk>\d+)/$',views.AddressUpdateAPIView.as_view()),
    url(r'^addresses2/(?P<pk>\d+)/$',views.AddressDeleteAPIView.as_view()),
    url(r'^addresses3/(?P<pk>\d+)/title/$',views.AddressTitleAPIView.as_view()),
    url(r'^addresses4/(?P<pk>\d+)/status/$',views.AddressDefaultAddressAPIView.as_view()),
    url(r'^emails/verification/$', views.UserEmailActiveView.as_view()),

     # 详情商品
    url(r'^browerhistories/$',views.UserHistoryView.as_view()),
]